t = codesters.Teacher()
try:
tval1 = t.find_function('turn_left')[0][1]
except:
tval1 = "DNE"
try:
tval2 = t.find_function('randint')[0][1]
tval3 = t.find_function('randint')[0][0]
tval3 = t.get_indent_at_line(tval3)
except:
tval2 = "DNE"
tval3 = "DNE"
try:
tval4 = t.find_text('.Sprite')[1][1]
tval7 = t.find_text('.Sprite')[1][0]
tval5 = t.get_indent_at_line(tval7)
except:
tval4 = "DNE"
tval5 = "DNE"
tval7 = "DNE"
try:
tval6 = t.find_function('event_interval')[0][0]
except:
tval6 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "DNE", "Great job!")
t1.add_failure(tval1 != "DNE", "Did you delete the Turn Left command from your Interval Event?")
t2 = TestObjective()
t2.add_success('1' in tval2 and '10' in tval2 and tval3 == 4, "Great job!")
t2.add_failure(tval2 == "DNE", "Did you add a Random Integer command inside your event?")
t2.add_failure(tval3 < 4, "Make sure you indent your Random Integer command inside your interval event.")
t2.add_failure(tval3 > 4, "Make sure you indent your Random Integer command only 4 spaces inside your interval event.")
t2.add_creative('1' not in tval2 or '10' not in tval2, "Did you change the range of your Random Integer command?")
# t3 = TestObjective()
# t3.add_success('"codester", 0, 0' in tval4 and tval5 == 4, "Great job!")
# t3.add_failure(tval4 == "DNE", "Did you add a Sprite at Position in your Interval Event?")
# t3.add_failure('0, 0' not in tval4, "Did you add a Sprite at Position in your event?")
# t3.add_failure(tval5 > 4, "Make sure your Sprite at Position is only indented 4 spaces inside your event.")
# t3.add_failure(tval5 < 4, "Make sure you nest your Sprite at Position 4 spaces inside your Interval Event.")
# t3.add_creative('codester' not in tval4, "You change the sprite's image! Creative choice!")
t4 = TestObjective()
t4.add_success(tval6 > tval7, "Great job!")
t4.add_failure(tval6 == "DNE", "Oops! Did you delete your event handler?")
# t4.add_failure(tval7 > tval6, "Make sure your Sprite at Position is inside your event, before the event handler.")
tester = TestManager()
tester.add_test_list([t1, t2, t4])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.